package com.dragon.english_practice_back.mapper;

import com.dragon.english_practice_back.entity.Grammars;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

/**
* @author 伫倚
* @description 针对表【grammars】的数据库操作Mapper
* @createDate 2025-04-15 15:28:40
* @Entity com.example.english_practice_back.entity.Grammars
*/
public interface GrammarsMapper extends BaseMapper<Grammars> {

    @MapKey("id")
    List<Map<String, Object>> getGrammarsWithProficiency(long limitStart, long size, int id, String orderBy, String order);

    // map的数据构成为: ("userId": "id", "grammarId", "proficiency": "proficiency")
    long batchUpdateProficiency(@Param("list") List<Map<String,Object>> list);
}




